using System;
using System.Xml;
using System.Xml.XPath;
using System.Text.RegularExpressions;

using Actions;
using Actions.Security;
using Actions.Connectors;
using Actions.Databases;

namespace Actions.Usecases
{
	public class UCSAdd : BaseUsecase
	{	
		public UCSAdd() : base()
		{}

		protected override void process(ref IConnector c, SecurityAgent sa)
		{
			SecurityModel sm = new SecurityModel();				
			string type = c.getInputParam("type");
			
			if(type != null && type.Length > 0 && Regex.IsMatch(type, sm.regType)) {
				sm.add(type, ref c);
				_d.DocumentElement.InnerXml += sm.showObjectsByType(type);
			}
			_d.setPrefix("ajax");
		}
	}
}
